package cn.mesmile.clickhouse.dao;

import cn.mesmile.clickhouse.entity.Book;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zb
 * @date 2021/7/4 23:22
 * @Description
 */
@Repository
public interface BookMapper {

    /**
     *  通过 videoId 来获取 Video
     * @return
     */
    @Select("select * from book limit 0,10")
    List<Book> getBook();

    /**
     * 保存数据
     * @param book
     * @return
     */
    @Insert({ "insert into book(id, name, author, publish_date,price,is_publish) values(#{id}, #{name}, #{author}, #{publishDate}, #{price},#{isPublish})" })
    int save(Book book);

}
